<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 考勤控制器
 */
class Attendance extends AdminBase
{
    
    /**
     * 考勤统计
     */
    public function attendanceList()
    {
        
        $this->assign('list', $this->logicAttendance->getAttendanceList());
        
        return $this->fetch('attendance_list');
    }
    
    /**
     * 出勤记录
     */
    public function attendanceAdd()
    {
        
        IS_POST && $this->jump($this->logicAttendance->attendanceEdit($this->param));
        
        return $this->fetch('attendance_edit');
    }
    
    /**
     * 后台补签
     */
    public function attendanceEdit()
    {
        
        IS_POST && $this->jump($this->logicAttendance->attendanceEdit($this->param));
        
        $info = $this->logicAttendance->getAttendanceInfo(['id' => $this->param['id']]);
        
        $this->assign('info', $info);
        
        return $this->fetch('attendance_edit');
    }
    
    /**
     * 删除记录
     */
    public function attendanceDel($id = 0)
    {
        
        $this->jump($this->logicAttendance->attendanceDel(['id' => $id]));
    }
      /**
     * 数据状态设置
     */
    public function setStatus()
    {
        
        $this->jump($this->logicAdminBase->setStatus('Attendance', $this->param));
    }
    
}
